import 'package:storage/generated/json/base/json_convert_content.dart';
import 'package:storage/model/company_model_entity.dart';

CompanyModelEntity $CompanyModelEntityFromJson(Map<String, dynamic> json) {
  final CompanyModelEntity companyModelEntity = CompanyModelEntity();
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    companyModelEntity.companyId = companyId;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    companyModelEntity.companyName = companyName;
  }
  return companyModelEntity;
}

Map<String, dynamic> $CompanyModelEntityToJson(CompanyModelEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyId'] = entity.companyId;
  data['companyName'] = entity.companyName;
  return data;
}

extension CompanyModelEntityExtension on CompanyModelEntity {
  CompanyModelEntity copyWith({
    int? companyId,
    String? companyName,
  }) {
    return CompanyModelEntity()
      ..companyId = companyId ?? this.companyId
      ..companyName = companyName ?? this.companyName;
  }
}